1. Field
The disclosure relates to device architectures and, more specifically but not exclusively, to expanders for SATA/SAS architectures having loops.
2. Description of the Related Art
This section introduces aspects that may help facilitate a better understanding of embodiments of the invention. Accordingly, the statements of this section are to be read in this light and are not to be understood as admissions about what is prior art or what is not prior art.
The SAS (Serial Attached SCSI (Small Computer System Interface)) protocol specifies a protocol stack that can be used to connect one or more controllers to a number of different target devices such as hard disk drives (HDDs). The SAS protocol specifies the transport layer protocols to transport SCSI commands, SATA (serial advanced technology attachment) commands, and management commands among target devices.
The SAS protocol defines the function of a SAS expander, which is part of the service delivery subsystem and facilitates communication between SAS-compatible devices. Devices connect to an expander across physical links attached to ports on the device and the expander. A “phy” is a transceiver that electrically interfaces with a physical link combined with the portions of the protocol that encode data and manage the reset sequences. A port is created when one or more phys share the same address and attach to a device through one or more physical links.
Multiple SAS expanders can be connected to form a loop in the topology of the resulting SAS architecture. A loop can exist in a SAS topology, for example, when one expander/initiator is indirectly and redundantly connected to the same end device along two parallel paths, each path containing one or more different intermediate expanders. Such a loop may be desirable for a number of reasons, including increased processing throughput and redundancy for failure protection.
Unfortunately, unless handled properly, the existence of such loops in SAS architectures will result in an infinite sequence of discovery messages transmitted between the expanders that form such a loop. According to the SAS protocol, when a discovery-triggering event occurs (e.g., when a SAS architecture is initially powered up or at the end of a reset sequence), each expander automatically performs a discovery procedure of communicating with each device to which it is directly connected to identify all of the different devices to which it is either directly connected or indirectly connected via other expanders. Each expander maintains this device-connection information in an internal device table. When an expander recognizes that it is connected to another expander, the first expander sends a message to the second expander asking the second expander for a list of devices to which it is connected so that the first expander can discover the devices to which it is indirectly connected via the second expander. Note that that second expander will also be similarly querying its own directly connected expanders, and so on. When a SAS architecture has a loop, unless the existence of the loop is somehow taken into account, an infinite sequence of discovery messaging will result as the different expanders that form the loop attempt to complete their individual discovery procedures, thereby preventing the SAS architecture from ever completing its discovery processing.